import { reactive } from "vue";
import type { FormRules } from "element-plus";

/** 自定义表单规则校验 */
export const formRules = reactive(<FormRules>{
	name: [{ required: true, message: "菜单名称为必填项", trigger: "blur" }],
	parentId: [{ required: true, message: "上级菜单为必填项", trigger: "blur" }],
	level: [{ required: true, message: "菜单等级为必填项", trigger: "change" }],
	path: [{ required: true, message: "路径为必填项", trigger: "blur" }],
	icon: [{ required: true, message: "图标标识为必填项", trigger: "blur" }],
	status: [{ required: true, message: "状态为必填项", trigger: "change" }],
	linkType: [{ required: true, message: "链接类型为必填项", trigger: "change" }],
	isPageMenu: [{ required: true, message: "是否为页面菜单为必填项", trigger: "change" }],
	linkUrl: [{ required: true, message: "链接地址为必填项", trigger: "blur" }],
	sort: [{ required: true, message: "排序为必填项", trigger: "blur" }],
});